package com.briup.cms.service.impl;
/**
 * @program: Consult_Management_Syetem1
 * @description:
 * @author: 马海兰
 * @create: 2020-07-02*
 **/
import com.briup.cms.bean.Privilege;
import com.briup.cms.dao.PrivilegeMapper;
import com.briup.cms.service.IPrivilegeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class PrivilegeServiceImpl implements IPrivilegeService {
    @Resource
    private PrivilegeMapper privilegeMapper;
    @Override
    public List<Privilege>findAll() {
        return privilegeMapper.selectAll();
    }
    @Override
    public void saveOrUpdate(Privilege privilege) {
        if(privilege.getId()!=null){
            privilegeMapper.update(privilege);
        } else {
            privilegeMapper.insert(privilege);
        }
    }

    @Override
    public void deleteById(long id) {
        privilegeMapper.deleteById(id);
    }
}
